using System;
using System.Collections.Generic;
using System.Net;

namespace Kannon.Core
{
    public class HttpResponseHeaderCollection : HttpHeaderCollection<HttpResponseHeader>
    {
        //
        // This is from System.Net.UnsafeNclNativeMethods+HttpApi+HTTP_RESPONSE_HEADER_ID
        private static readonly string[] HttpResponseHeaders = {
            "Cache-Control", "Connection", "Date", "Keep-Alive", "Pragma", "Trailer", "Transfer-Encoding", "Upgrade", "Via", "Warning", "Allow", "Content-Length", 
            "Content-Type", "Content-Encoding", "Content-Language", "Content-Location", "Content-MD5", "Content-Range", "Expires", "Last-Modified", "Accept-Ranges", 
            "Age", "ETag", "Location", "Proxy-Authenticate", "Retry-After", "Server", "Set-Cookie", "Vary", "WWW-Authenticate"
        };

        private static readonly Func<HttpResponseHeader, string> HttpResponseHeaderConverter = h => HttpResponseHeaders[(int)h];

        public HttpResponseHeaderCollection() : 
            this(new Dictionary<string, string>())
        {
        }

        public HttpResponseHeaderCollection(IDictionary<string, string> dictionary) : 
            base(HttpResponseHeaderConverter, dictionary)
        {
        }
    }
}